<template>
	<view>
		<view class="order-title-block">
			<view class="order-name">
				{{order.name}}
			</view>
			<view class="buy-finish" v-if="order.status == 1">
				<view class="MoneyOrNumber">
					{{order.buyMoney}}元
				</view>
				<text class="text">可赎回天数{{order.freeDay}}天</text>
			</view>
		</view>
		
		<view class="order-details">
			<view class="detail-block">
				<view class="detail" style="color: #000000;">
					买入信息
				</view>
				<view class="detail">
					<view class="detail-left">
						买入产品
					</view>
					<view class="detail-right">
						{{order.name}}
					</view>
				</view>
				
				<view class="detail">
					<view class="detail-left">
						买入金额
					</view>
					<view class="detail-right">
						{{order.buyMoney}}
					</view>
				</view>
				
				<view class="detail">
					<view class="detail-left">
						确认份额
					</view>
					<view class="detail-right">
						{{order.buyNumber}}
					</view>
				</view>
				
				<view class="detail">
					<view class="detail-left">
						买入净值
					</view>
					<view class="detail-right">
						{{order.buyPrice}}
					</view>
				</view>
				
				<view class="detail">
					<view class="detail-left">
						买入时间
					</view>
					<view class="detail-right">
						{{order.buyDay.split('T')[0]}}
					</view>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	
	var _self
	
	export default {
		data() {
			return {
				order: {
					buyDay: ""
				}
			}
		},
		async onLoad(data) {
			_self = this
			this.getOrderDetail(data.orderId )
		},
		methods: {
			async getOrderDetail(orderId) {
				if(orderId != null && orderId != undefined){
					uni.showLoading({
						title:'加载中...',
						mask:false
					})
					_self.order = await _self.store.getOrderDetail(orderId)
					uni.hideLoading()
				}
			}
		}
	}
</script>

<style>
	@import url("orderDetail.css");
</style>
